# release settings
CPPFLAGS=-Isrc -g -O2 -Wall -c -fmessage-length=0 -fPIC -MMD -MP

all: logger4cpp.so

logger4cpp.so: logger.a
	@echo "Creating Shared Library"
	@ar rcs logger4cpp.a src/logger/*.o 
	gcc -shared -Wl,-soname,liblogger4cpp.so -o liblogger4cpp.so.1.0.0 src/logger/*.o

logger.a: src/logger/*.cpp src/logger/*.h
	@echo "Compiling logger..."
	@g++ $(CPPFLAGS) -MF"src/logger/Logger.d" -MT"src/logger/Logger.d" -o"src/logger/Logger.o" "src/logger/Logger.cpp"
	@g++ $(CPPFLAGS) -MF"src/logger/LoggerFactory.d" -MT"src/logger/LoggerFactory.d" -o"src/logger/LoggerFactory.o" "src/logger/LoggerFactory.cpp"
	@ar rcs logger.a src/logger/*.o

clean:
	find . -name "*.d" -exec rm -f {} \;
	find . -name "*.a" -exec rm -f {} \;
	find . -name "*.o" -exec rm -f {} \;
	find . -name "*.so" -exec rm -f {} \;

